#include "Base/CurrectProcess.h"
#include <cstdio>

namespace toym
{

char CurrectProcess::s_pidStr[12] = { 0 };
const char* CurrectProcess::s_pPidStr = nullptr;

const char* CurrectProcess::getPidStr() {
    if (s_pPidStr == nullptr) {
        ::snprintf(s_pidStr, sizeof(s_pidStr), "%d", getPid());
        s_pPidStr = s_pidStr;
    }
    return s_pPidStr;
}

} // namespace toym
